<template>
  <div>
    <el-container style="min-height: 100vh">
      <el-header style="padding: 0 0">
        <Header :user="user"></Header>
      </el-header>
      <el-container>
        <el-aside width="200px" style="margin-left: 180px; margin-top: 50px">
          <PersonSide></PersonSide>
        </el-aside>
        <el-main style="margin-left: 40px; margin-top: 20px;">
          <router-view></router-view>
        </el-main>
      </el-container>

      <el-footer style="padding: 0 0">
        <Footer></Footer>
      </el-footer>
    </el-container>
  </div>
</template>

<script>
import Header from "@/components/Header";
import Footer from "@/components/Footer";
import PersonSide from "@/components/Person/PersonSide";

export default {
  name: "PersonManage",
  components:{
    Footer,
    Header,
    PersonSide
  },
  data(){
    return{
      user: {}
    }
  },
  methods:{
    getUser: function () {
      // 调用获取用户信息接口
      // var url = axios.defaults.baseURL + ":8000/member/user/info/me"
      // axios.get(url).then(res => {
      //   if (res.data.code == 200){
      //     var user = res.data.data;
      //     // 设置 用户信息
      //     localStorage.setItem("user", JSON.stringify(user));
      //     this.user = JSON.parse(localStorage.getItem("user"))
      //   }else{
      //     this.$message.error("网络异常，用户信息获取失败")
      //   }
      // })

      this.user = {
        id: 1635088985338245122,
        userName: "admin",
        avatar: "https://p.qqan.com/up/2021-6/16246735796128385.png",
        nickName: "测试账号",
        sex: 0
      }
    }
  },
  mounted() {
    this.getUser()
  }
}
</script>

<style scoped>

</style>